import request from '@/utils/request';
import type { AxiosPromise } from '@/utils/request';
import type { ExpenseReimbursementVO, ExpenseReimbursementForm, ExpenseReimbursementQuery } from '@/pagesA/api/workflow/expenseReimbursement/types';

/**
 * 查询费用报销单列表
 * @param query
 * @returns {*}
 */

export const listExpenseReimbursement = (query?: ExpenseReimbursementQuery): AxiosPromise<ExpenseReimbursementVO[]> => {
  return request({
    url: '/workflow/expenseReimbursement/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询费用报销单详细
 * @param id
 */
export const getExpenseReimbursement = (id: string | number): AxiosPromise<ExpenseReimbursementVO> => {
  return request({
    url: '/workflow/expenseReimbursement/' + id,
    method: 'get'
  });
};

/**
 * 新增费用报销单
 * @param data
 */
export const addExpenseReimbursement = (data: ExpenseReimbursementForm) => {
  return request({
    url: '/workflow/expenseReimbursement',
    method: 'post',
    data: data
  });
};

/**
 * 修改费用报销单
 * @param data
 */
export const updateExpenseReimbursement = (data: ExpenseReimbursementForm) => {
  return request({
    url: '/workflow/expenseReimbursement',
    method: 'put',
    data: data
  });
};

/**
 * 删除费用报销单
 * @param id
 */
export const delExpenseReimbursement = (id: string | number | Array<string | number>) => {
  return request({
    url: '/workflow/expenseReimbursement/' + id,
    method: 'delete'
  });
};
